<?php
/**
 * @package Autogenerator for Joomla!
 * @version 3.0.0
 * @author Truong Cong Duc <truongcongduc4@gmail.com>
 * @link autogenerator.blogspot.com
 * @copyright (c) 2013, Truong Cong Duc
 * @license GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

// Load the tooltip behavior.
JHtml::_('behavior.tooltip');
JHtml::_('behavior.formvalidation');
JHtml::_('behavior.keepalive');
JHtml::_('formbehavior.chosen', 'select');
JHtml::_('behavior.modal', 'a.tables-modal-review');

$app = JFactory::getApplication();
$input = $app->input;
?>
<link rel="stylesheet" href="<?php echo JUri::root() . AUTOGENERATOR_URL_CSS . 'autogenerator.css'; ?>" type="text/css">
<script src="<?php echo JUri::root() . AUTOGENERATOR_URL_JS . 'autogenerator.js'; ?>" type="text/javascript"></script>

<script type="text/javascript">
    Joomla.submitbutton = function(task) {
        if (task == 'mvc.cancel' || document.formvalidator.isValid(document.id('item-form'))) {
            Joomla.submitform(task, document.getElementById('item-form'));
        } else {
            alert('<?php echo $this->escape(JText::_('JGLOBAL_VALIDATION_FORM_FAILED')); ?>');
        }
    }
</script>

<form action="<?php echo JRoute::_('index.php?option=com_autogenerator&layout=list&id=' . (int) $this->item->id); ?>" method="post" name="adminForm" id="item-form" class="form-validate">
    <div class="row-fluid">
        <div class="span10 form-horizontal">
            <ul class="nav nav-tabs">
                <li class="active">
                    <a href="#administrator-form" data-toggle="tab">
                        <?php echo JText::_('COM_AUTOGENERATOR_MVC_LIST_ADMINISTRATOR'); ?>
                    </a>
                </li>
                <li>
                    <a href="#front-end-form" data-toggle="tab">
                        <?php echo JText::_('COM_AUTOGENERATOR_MVC_LIST_FRONT_END'); ?>
                    </a>
                </li>
            </ul>

            <div class="tab-content">
                <div class="tab-pane active" id="administrator-form">
                    <fieldset class="adminform">
                        <div class="control-group form-inline">
                            <div class="control-label"><?php echo JText::_('COM_AUTOGENERATOR_MVC_REVIEW_VIEWS') . JText::_('COM_AUTOGENERATOR_MVC_ADMINISTRATOR'); ?></div>
                            <div class="controls">&nbsp;</div>
                        </div>
                        
                        <div class="control-group form-inline">
                            <div class="control-label"><span class="gi">|&mdash;&mdash;</span><?php echo JText::_('COM_AUTOGENERATOR_MVC_REVIEW_VIEWS_LIST'); ?></div>
                            <div class="controls review-code">
                                <span><?php echo JText::_('COM_AUTOGENERATOR_MVC_REVIEW_VIEW_LIST_VIEW_HTML_PHP'); ?></span>
                                <a class="tables-modal-review" href="<?php echo JRoute::_('index.php?option=com_autogenerator&file=view.html.php&view=mvc&layout=review&type=list&tmpl=component&id=' . $this->item->id); ?>" rel="{handler: 'iframe', size: {x: 800, y: 500}}" title="<?php echo JText::_('COM_AUTOGENERATOR_MVC_REVIEW'); ?>">
                                    <?php echo JText::_('COM_AUTOGENERATOR_MVC_REVIEW'); ?>
                                </a>
                                <a href="<?php echo JRoute::_('index.php?option=com_autogenerator&task=mvc.exportPHPFile&file=view.html.php&type=list&id=' . $this->item->id); ?>" title="<?php echo JText::_('COM_AUTOGENERATOR_MVC_EXPORT'); ?>">
                                    <?php echo JText::_('COM_AUTOGENERATOR_MVC_EXPORT'); ?>
                                </a>
                                
                                <span class="space-code"><?php echo JText::_('COM_AUTOGENERATOR_MVC_REVIEW_VIEW_LIST_DEFAULT_PHP'); ?></span>
                                <a class="tables-modal-review" href="<?php echo JRoute::_('index.php?option=com_autogenerator&file=default.php&view=mvc&layout=review&tmpl=component&id=' . $this->item->id); ?>" rel="{handler: 'iframe', size: {x: 800, y: 500}}" title="<?php echo JText::_('COM_AUTOGENERATOR_MVC_REVIEW'); ?>">
                                    <?php echo JText::_('COM_AUTOGENERATOR_MVC_REVIEW'); ?>
                                </a>
                                <a href="<?php echo JRoute::_('index.php?option=com_autogenerator&task=mvc.exportPHPFile&file=default.php&id=' . $this->item->id); ?>" title="<?php echo JText::_('COM_AUTOGENERATOR_MVC_EXPORT'); ?>">
                                    <?php echo JText::_('COM_AUTOGENERATOR_MVC_EXPORT'); ?>
                                </a>
                            </div>
                        </div>
                        
                        <div class="control-group form-inline">
                            <div class="control-label"><?php echo JText::_('COM_AUTOGENERATOR_MVC_REVIEW_MODELS') . JText::_('COM_AUTOGENERATOR_MVC_ADMINISTRATOR'); ?></div>
                            <div class="controls">&nbsp;</div>
                        </div>
                        <div class="control-group form-inline">
                            <div class="control-label"><span class="gi">|&mdash;&mdash;</span><?php echo JText::_('COM_AUTOGENERATOR_MVC_REVIEW_MODELS_MODEL'); ?></div>
                            <div class="controls review-code">&nbsp;</div>
                        </div>
                        
                        <div class="control-group form-inline">
                            <div class="control-label"><span class="gi">|&mdash;&mdash;|&mdash;&mdash;</span><?php echo JText::_('COM_AUTOGENERATOR_MVC_REVIEW_MODELS_MODEL_LIST'); ?></div>
                            <div class="controls review-code">
                                <span><?php echo $this->item->title . '.php'; ?></span>
                                <a class="tables-modal-review" href="<?php echo JRoute::_('index.php?option=com_autogenerator&file=models.php&view=mvc&layout=review&tmpl=component&id=' . $this->item->id); ?>" rel="{handler: 'iframe', size: {x: 800, y: 500}}" title="<?php echo JText::_('COM_AUTOGENERATOR_MVC_REVIEW'); ?>">
                                    <?php echo JText::_('COM_AUTOGENERATOR_MVC_REVIEW'); ?>
                                </a>
                                <a href="<?php echo JRoute::_('index.php?option=com_autogenerator&task=mvc.exportPHPFile&file=models.php&id=' . $this->item->id); ?>" title="<?php echo JText::_('COM_AUTOGENERATOR_MVC_EXPORT'); ?>">
                                    <?php echo JText::_('COM_AUTOGENERATOR_MVC_EXPORT'); ?>
                                </a>
                            </div>
                        </div>
                        
                        <div class="control-group form-inline">
                            <div class="control-label"><?php echo JText::_('COM_AUTOGENERATOR_MVC_REVIEW_CONTROLLERS') . JText::_('COM_AUTOGENERATOR_MVC_ADMINISTRATOR'); ?></div>
                            <div class="controls">&nbsp;</div>
                        </div>
                        <div class="control-group form-inline">
                            <div class="control-label"><span class="gi">|&mdash;&mdash;</span><?php echo JText::_('COM_AUTOGENERATOR_MVC_REVIEW_CONTROLLERS_LIST'); ?></div>
                            <div class="controls review-code">
                                <span><?php echo $this->item->title . '.php'; ?></span>
                                <a class="tables-modal-review" href="<?php echo JRoute::_('index.php?option=com_autogenerator&file=controllers.php&view=mvc&layout=review&tmpl=component&id=' . $this->item->id); ?>" rel="{handler: 'iframe', size: {x: 800, y: 500}}" title="<?php echo JText::_('COM_AUTOGENERATOR_MVC_REVIEW'); ?>">
                                    <?php echo JText::_('COM_AUTOGENERATOR_MVC_REVIEW'); ?>
                                </a>
                                <a href="<?php echo JRoute::_('index.php?option=com_autogenerator&task=mvc.exportPHPFile&file=controllers.php&id=' . $this->item->id); ?>" title="<?php echo JText::_('COM_AUTOGENERATOR_MVC_EXPORT'); ?>">
                                    <?php echo JText::_('COM_AUTOGENERATOR_MVC_EXPORT'); ?>
                                </a>
                            </div>
                        </div>
                        
                    </fieldset>
                </div>
                <div class="tab-pane" id="front-end-form">
                    <fieldset class="adminform">
                        <div class="control-group form-inline">
                            <div class="control-label"><?php echo JText::_('COM_AUTOGENERATOR_MVC_REVIEW_VIEWS') . JText::_('COM_AUTOGENERATOR_MVC_FRONT_END'); ?></div>
                            <div class="controls">&nbsp;</div>
                        </div>
                        
                        <div class="control-group form-inline">
                            <div class="control-label"><span class="gi">|&mdash;&mdash;</span><?php echo JText::_('COM_AUTOGENERATOR_MVC_REVIEW_VIEWS_LIST'); ?></div>
                            <div class="controls review-code">
                                <span><?php echo JText::_('COM_AUTOGENERATOR_MVC_REVIEW_VIEW_LIST_VIEW_HTML_PHP'); ?></span>
                                <a class="tables-modal-review" href="<?php echo JRoute::_('index.php?option=com_autogenerator&bIsAdmin=0&file=view.html.php&view=mvc&layout=review&type=list&tmpl=component&id=' . $this->item->id); ?>" rel="{handler: 'iframe', size: {x: 800, y: 500}}" title="<?php echo JText::_('COM_AUTOGENERATOR_MVC_REVIEW'); ?>">
                                    <?php echo JText::_('COM_AUTOGENERATOR_MVC_REVIEW'); ?>
                                </a>
                                <a href="<?php echo JRoute::_('index.php?option=com_autogenerator&bIsAdmin=0&task=mvc.exportPHPFile&file=view.html.php&type=list&id=' . $this->item->id); ?>" title="<?php echo JText::_('COM_AUTOGENERATOR_MVC_EXPORT'); ?>">
                                    <?php echo JText::_('COM_AUTOGENERATOR_MVC_EXPORT'); ?>
                                </a>
                                
                                <span class="space-code"><?php echo JText::_('COM_AUTOGENERATOR_MVC_REVIEW_VIEW_LIST_DEFAULT_PHP'); ?></span>
                                <a class="tables-modal-review" href="<?php echo JRoute::_('index.php?option=com_autogenerator&bIsAdmin=0&file=default.php&view=mvc&layout=review&tmpl=component&id=' . $this->item->id); ?>" rel="{handler: 'iframe', size: {x: 800, y: 500}}" title="<?php echo JText::_('COM_AUTOGENERATOR_MVC_REVIEW'); ?>">
                                    <?php echo JText::_('COM_AUTOGENERATOR_MVC_REVIEW'); ?>
                                </a>
                                <a href="<?php echo JRoute::_('index.php?option=com_autogenerator&bIsAdmin=0&task=mvc.exportPHPFile&file=default.php&id=' . $this->item->id); ?>" title="<?php echo JText::_('COM_AUTOGENERATOR_MVC_EXPORT'); ?>">
                                    <?php echo JText::_('COM_AUTOGENERATOR_MVC_EXPORT'); ?>
                                </a>
                            </div>
                        </div>
                        
                        <div class="control-group form-inline">
                            <div class="control-label"><?php echo JText::_('COM_AUTOGENERATOR_MVC_REVIEW_MODELS') . JText::_('COM_AUTOGENERATOR_MVC_FRONT_END'); ?></div>
                            <div class="controls">&nbsp;</div>
                        </div>
                        <div class="control-group form-inline">
                            <div class="control-label"><span class="gi">|&mdash;&mdash;</span><?php echo JText::_('COM_AUTOGENERATOR_MVC_REVIEW_MODELS_MODEL'); ?></div>
                            <div class="controls review-code">&nbsp;</div>
                        </div>
                        
                        <div class="control-group form-inline">
                            <div class="control-label"><span class="gi">|&mdash;&mdash;|&mdash;&mdash;</span><?php echo JText::_('COM_AUTOGENERATOR_MVC_REVIEW_MODELS_MODEL_LIST'); ?></div>
                            <div class="controls review-code">
                                <span><?php echo $this->item->title . '.php'; ?></span>
                                <a class="tables-modal-review" href="<?php echo JRoute::_('index.php?option=com_autogenerator&bIsAdmin=0&file=models.php&view=mvc&layout=review&tmpl=component&id=' . $this->item->id); ?>" rel="{handler: 'iframe', size: {x: 800, y: 500}}" title="<?php echo JText::_('COM_AUTOGENERATOR_MVC_REVIEW'); ?>">
                                    <?php echo JText::_('COM_AUTOGENERATOR_MVC_REVIEW'); ?>
                                </a>
                                <a href="<?php echo JRoute::_('index.php?option=com_autogenerator&bIsAdmin=0&task=mvc.exportPHPFile&file=models.php&id=' . $this->item->id); ?>" title="<?php echo JText::_('COM_AUTOGENERATOR_MVC_EXPORT'); ?>">
                                    <?php echo JText::_('COM_AUTOGENERATOR_MVC_EXPORT'); ?>
                                </a>
                            </div>
                        </div>
                        
                        <div class="control-group form-inline">
                            <div class="control-label"><?php echo JText::_('COM_AUTOGENERATOR_MVC_REVIEW_CONTROLLERS') . JText::_('COM_AUTOGENERATOR_MVC_FRONT_END'); ?></div>
                            <div class="controls">&nbsp;</div>
                        </div>
                        <div class="control-group form-inline">
                            <div class="control-label"><span class="gi">|&mdash;&mdash;</span><?php echo JText::_('COM_AUTOGENERATOR_MVC_REVIEW_CONTROLLERS_LIST'); ?></div>
                            <div class="controls review-code">
                                <span><?php echo $this->item->title . '.php'; ?></span>
                                <a class="tables-modal-review" href="<?php echo JRoute::_('index.php?option=com_autogenerator&bIsAdmin=0&file=controllers.php&view=mvc&layout=review&tmpl=component&id=' . $this->item->id); ?>" title="<?php echo JText::_('COM_AUTOGENERATOR_MVC_REVIEW'); ?>">
                                    <?php echo JText::_('COM_AUTOGENERATOR_MVC_REVIEW'); ?>
                                </a>
                                <a href="<?php echo JRoute::_('index.php?option=com_autogenerator&bIsAdmin=0&task=mvc.exportPHPFile&file=controllers.php&id=' . $this->item->id); ?>" title="<?php echo JText::_('COM_AUTOGENERATOR_MVC_EXPORT'); ?>">
                                    <?php echo JText::_('COM_AUTOGENERATOR_MVC_EXPORT'); ?>
                                </a>
                            </div>
                        </div>
                        
                    </fieldset>
                </div>
                <input type="hidden" name="task" value="" />
                <input type="hidden" name="return" value="<?php echo $input->getCmd('return'); ?>" />
                <?php echo JHtml::_('form.token'); ?>
            </div>
        </div>
    </div>
</form>
